import request from '@/utils/request'

export default{
  //查询所有
  getList(currentPage,pageSize,brand){
    return request({
      url: `/brand/${currentPage}/${pageSize}`,
      method:'post',
      data:brand
    })
  },
  //添加品牌
  add(brand){
    return request({
      url: `/brand/`,
      method:'post',
      data:brand
    })
  },
  //根据id查询
  queryById(id){
    return request({
      url: `/brand/${id}/`,
      method:'get',
    })
  },
  //根据id删除
  removeById(id){
    return request({
      url: `/brand/${id}/`,
      method:'delete',
    })
  },
  //编辑（修改）
  modify(brand){
    return request({
      url: `/brand/`,
      method:'put',
      data:brand
    })
  },
  //根据父id查询品牌
  queryBrandByParentId(parentId){
    return request({
      url: `/brand/parent/${parentId}/`,
      method:'get',
    })
  },
  //查询所有的父品牌
  queryBrandAll(){
    return request({
      url: `/brand/parent/`,
      method:'get',
    })
  },

}

